//
//  HLTFriendsTableViewController.m
//  huiliantong
//
//  Created by hlt on 15/9/2.
//  Copyright (c) 2015年 hlt. All rights reserved.
//

#import "HLTFriendsTableViewController.h"
#import "HLTfriendsTableViewCell.h"
@interface HLTFriendsTableViewController ()



@property NSArray *friendsary;

@end

@implementation HLTFriendsTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    
    
    
    NSMutableDictionary *dic=[@{ @"tel" : @"18285114569", @"nicheng" : @"王伟"} mutableCopy];
    
    
    _friendsary=[NSArray arrayWithObjects:dic,dic,dic,nil];

    
    
    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;
    
    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    // Return the number of sections.
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    // Return the number of rows in the section.
    return [self.friendlist count];
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    //    static NSString *identify1 = @"HLTloginTableViewCell";
    static NSString *identify1 = @"HLTfriendsTableViewCell";
    
    //    HLTloginTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identify1];
    HLTfriendsTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identify1];
    if(cell == nil)
    {
        //        cell= [[[NSBundle mainBundle]loadNibNamed:@"HLTloginTableViewCell" owner:nil options:nil] firstObject];
        cell= [[[NSBundle mainBundle]loadNibNamed:@"HLTfriendsTableViewCell" owner:nil options:nil] firstObject];
    }
    //    cell.backgroundColor=[UIColor clearColor];//关键语句
    cell.selectionStyle=UITableViewCellSelectionStyleNone;
    
    cell.Tel.text=self.friendlist[indexPath.row][@"contact_user_name"];
    cell.nicheng.text=self.friendlist[indexPath.row][@"contact_name"];
    
    
    return cell;
}


- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    return 50;
    
}



#pragma mark - UITableViewDelegate
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
//  
//        if (indexPath.row !=0) {
//           
////            [self.navigationController pushViewController:newC animated:YES]; //跳转到下一页面
//            
////            HLTfriendsTableViewCell *cell = [tableView  cellForRowAtIndexPath:indexPath];
//            
    
            self.parent.tel= self.friendlist[indexPath.row][@"contact_user_name"];
            self.parent.nicheng=self.friendlist[indexPath.row][@"contact_name"];
            [self.navigationController popViewControllerAnimated:YES]; //返回上一页面
            
            
            
            
//        }
    

}






@end
